package o;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.widget.Toast;
import com.huawei.hms.support.api.entity.hwid.HwIDConstant.ACTION;
import kotlin.Metadata;
import kotlin.TypeCastException;
import o.ewm.n;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 \u001b2\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0002\u001a\u001bB\u0015\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0012\u0010\n\u001a\u0004\u0018\u00010\u000b2\u0006\u0010\f\u001a\u00020\u0002H\u0002J\u0018\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u0011H\u0016J\u0018\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u000f\u001a\u00020\u00022\u0006\u0010\u0014\u001a\u00020\u0015H\u0016J\b\u0010\u0016\u001a\u00020\u000eH\u0002J\u0018\u0010\u0017\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0018H\u0016J\u0010\u0010\u0019\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0002H\u0016R\u000e\u0010\b\u001a\u00020\u0006X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0004X\u000e¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Lcom/huawei/appmarket/service/noapk/shortcut/NoApkShortcutExtensions;", "Lcom/huawei/appgallery/shortcutbundle/api/IShortcutExtensions;", "Lcom/huawei/appmarket/service/noapk/shortcut/NoApkBean;", "context", "Landroid/content/Context;", "callback", "Lcom/huawei/appmarket/service/noapk/shortcut/NoApkShortcutExtensions$AbortCallBack;", "(Landroid/content/Context;Lcom/huawei/appmarket/service/noapk/shortcut/NoApkShortcutExtensions$AbortCallBack;)V", "mCallBack", "mContext", "getStartCenterIntent", "Landroid/content/Intent;", "userData", "onAbort", "", "shortcutData", "error", "", "onCompare", "", "shortcut", "Lcom/huawei/appgallery/shortcutmanager/api/HwShortcutInfo;", "onCreateShortCutFailed", "onCreateShortcutInfo", "Lcom/huawei/appgallery/shortcutbundle/api/IShortcutExtensions$ICreateShortcutInfoCallback;", "onPinned", "AbortCallBack", "Companion", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
public final class ebw implements cxv<ebu> {
    public static final b ˊ = new b();
    private c ˋ;
    private Context ॱ;

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\bf\u0018\u00002\u00020\u0001J\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H&J\u0010\u0010\b\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&¨\u0006\t"}, d2 = {"Lcom/huawei/appmarket/service/noapk/shortcut/NoApkShortcutExtensions$AbortCallBack;", "", "onAbort", "", "shortcutData", "Lcom/huawei/appmarket/service/noapk/shortcut/NoApkBean;", "result", "", "onPinned", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
    public interface c {
        void ˏ(@NotNull ebu o_ebu);

        void ॱ(@NotNull ebu o_ebu, int i);
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000¨\u0006\u0005"}, d2 = {"Lcom/huawei/appmarket/service/noapk/shortcut/NoApkShortcutExtensions$Companion;", "", "()V", "TAG", "", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
    public static final class b {
        private b() {
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "run"}, k = 3, mv = {1, 1, 15})
    static final class d implements Runnable {
        final /* synthetic */ ebw ॱ;

        d(ebw o_ebw) {
            this.ॱ = o_ebw;
        }

        public final void run() {
            Toast.makeText(this.ॱ.ॱ, n.ﾞˋ, 0).show();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/graphics/Bitmap;", "kotlin.jvm.PlatformType", "onImageLoaded"}, k = 3, mv = {1, 1, 15})
    static final class e implements eqz {
        final /* synthetic */ a ˋ;
        final /* synthetic */ ebw ˏ;
        final /* synthetic */ ebu ॱ;

        e(ebw o_ebw, ebu o_ebu, a aVar) {
            this.ˏ = o_ebw;
            this.ॱ = o_ebu;
            this.ˋ = aVar;
        }

        public final void ॱ(Bitmap bitmap) {
            Intent ˊ = this.ˏ.ˋ(this.ॱ);
            if (bitmap == null || !(this.ˏ.ॱ instanceof Activity) || !this.ॱ.ˋ() || ˊ == null) {
                Logger.ˋ("NoApkShortcutExtensions", "onImageLoaded load error");
                this.ˏ.ˏ();
                return;
            }
            String ˎ = this.ॱ.ˎ();
            if (ˎ == null) {
                fsd.ˎ();
            }
            o.cxx.d ˊ2 = new o.cxx.d(ˎ).ˊ(ˊ);
            String ॱ = this.ॱ.ॱ();
            if (ॱ == null) {
                fsd.ˎ();
            }
            cxx ˊ3 = ˊ2.ˎ(ॱ).ˊ(cxz.ˏ(bitmap)).ˊ();
            fsd.ॱ(ˊ3, "HwShortcutInfo.Builder(s…                 .build()");
            this.ˋ.ॱ(ˊ3);
        }
    }

    public ebw(@NotNull Context context, @NotNull c cVar) {
        fsd.ˊ(context, "context");
        fsd.ˊ(cVar, "callback");
        this.ॱ = context;
        this.ˋ = cVar;
    }

    public /* synthetic */ void ˋ(cxs o_cxs) {
        ˊ((ebu) o_cxs);
    }

    public /* synthetic */ void ˎ(cxs o_cxs, int i) {
        ˋ((ebu) o_cxs, i);
    }

    public /* synthetic */ boolean ˎ(cxs o_cxs, cxx o_cxx) {
        return ˊ((ebu) o_cxs, o_cxx);
    }

    public /* synthetic */ void ॱ(cxs o_cxs, a aVar) {
        ˋ((ebu) o_cxs, aVar);
    }

    public void ˋ(@NotNull ebu o_ebu, int i) {
        fsd.ˊ(o_ebu, "shortcutData");
        this.ˋ.ॱ(o_ebu, i);
    }

    public boolean ˊ(@NotNull ebu o_ebu, @NotNull cxx o_cxx) {
        fsd.ˊ(o_ebu, "shortcutData");
        fsd.ˊ(o_cxx, "shortcut");
        return false;
    }

    public void ˋ(@NotNull ebu o_ebu, @NotNull a aVar) {
        fsd.ˊ(o_ebu, "shortcutData");
        fsd.ˊ(aVar, "callback");
        eqx.ˎ(this.ॱ, o_ebu.ʽ(), (eqz) new e(this, o_ebu, aVar), true);
    }

    public void ˊ(@NotNull ebu o_ebu) {
        fsd.ˊ(o_ebu, "shortcutData");
        this.ˋ.ˏ(o_ebu);
    }

    private final void ˏ() {
        if (this.ॱ instanceof Activity) {
            Context context = this.ॱ;
            if (context == null) {
                throw new TypeCastException("null cannot be cast to non-null type android.app.Activity");
            }
            ((Activity) context).runOnUiThread(new d(this));
        }
    }

    private final Intent ˋ(ebu o_ebu) {
        Logger.ˏ("NoApkShortcutExtensions", "fUrl = " + o_ebu.ॱॱ());
        String ॱॱ = o_ebu.ॱॱ();
        if (ॱॱ == null) {
            return null;
        }
        Intent intent = new Intent();
        intent.setAction(ACTION.HWID_SCHEME_URL);
        intent.setData(Uri.parse(ॱॱ));
        intent.setFlags(268435456);
        return intent;
    }
}
